<template>
  <div class="chart" ref="chartRef"></div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from "vue";
import * as echarts from "echarts";
const props = defineProps<{ options: Record<string, any> }>();
const chartRef = ref();
onMounted(() => {
  if (!props.options && !chartRef.value) return;
  const myChart = echarts.init(chartRef.value);
  myChart.setOption(props.options);
});
</script>
<style lang="scss" scoped>
.chart {
  width: 100%;
  height: 100%;
}
</style>
